﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <title>SAMPLE JAVASCRIPT DEMO</title>
        <script  type="text/javascript">
            function show() {
                var a = document.mainForm.firstName.value
                var b = document.mainForm.lastName.value
                var c = a + "___" + b
                alert(c)

                return true
            }
        </script>
</head>

<body>
       <form name="mainForm" action="" method="post" onsubmit="return show()">
		     First name: <input type="text" name="firstName" />
		    <span id="firstNameError" style="color:red; display:none">* invalid!</span>
		     Last name: <input type="text" name="lastName" />
		    <span id="lastNameError" style="color:red; display:none">* invalid!</span>
		    <div id="errorMessages" style="color:red; display:none"></div>
		    <input type="button" value="haha"/>
       </form>
</body>


</html>
